#ifndef PGGAME_H
#define PGGAME_H

class PGPokerConnection;
class PGHand;
class PGHandRanks;
class PGPokerSavedGame;

class PGPokerGame
{
	public:
		PGPokerGame(PGPokerConnection*, int32 bet, int32 useCommission);
		PGPokerGame(PGPokerConnection*, PGPokerSavedGame*);
		~PGPokerGame();

		bool8 deal(int32 balance);
		void split(int32 twocard[2], int32 balance);

		void send();
		void save(PGPokerSavedGame*);

		int32 numCardsToDeal();

	protected:
		enum Outcomes { O_DEALER_WON, O_PLAYER_WON, O_PUSH };

		void determineOutcomes(PGHandRanks*, PGHandRanks*,
			Outcomes*, Outcomes*, Outcomes*);
		void determineJokerAsRanks(PGHandRanks*, PGHandRanks*,
			int32*, int32*);
		int32 calcPayout(Outcomes, int32*, int32*);

		void restore(PGPokerSavedGame*);

	protected:
		PGPokerConnection*	conn;
		int32				bet;
		int32				useCommission;
		PGHand*				dealer;
		PGHand*				player;
        int32               m_nDeckSeed;
		//
		// *IMPORTANT*  When adding/changing here, be sure to update
		//				constructors/destructor, send(), save(), restore()
		//
};

#endif
